package com.onlyphoto.onlymall.mvp.model

import com.onlyphoto.onlymall.api.Urls
import com.onlyphoto.onlymall.base.BaseModel
import com.onlyphoto.onlymall.base.BaseObserver
import com.onlyphoto.onlymall.bean.request.ExpressBean
import com.onlyphoto.onlymall.bean.response.LogisticsBean
import com.onlyphoto.onlymall.utils.ConfigUtil
import com.onlyphoto.onlymall.utils.RxTransformer


class MLogisticsImpl : BaseModel() {
    fun getLogistics(bean: ExpressBean, baseObserver: BaseObserver<ArrayList<LogisticsBean>>) {
        val url = ConfigUtil.instance.getUrl(Urls.LOGISTICS)
        apiService().getLogistics(url, bean.toMap())
                .compose(RxTransformer.switchSchedulers(this))
                .subscribe(baseObserver)
    }
}
